package com.imut.lagain.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.LocalDateTime;

/**
 * 思维分析实体类
 */
@Entity
@Table(name = "thought_analysis")
@TableName("thought_analysis")
public class ThoughtAnalysis {
    private static final Logger log = LoggerFactory.getLogger(ThoughtAnalysis.class);

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Column(name = "user_id", nullable = false)
    @TableField("user_id")
    private Long userId;

    @Column(name = "session_id")
    @TableField("session_id")
    private String sessionId;

    @Column(name = "thought_content", columnDefinition = "TEXT")
    @TableField("thought_content")
    private String thoughtContent;

    @Column(name = "analysis_result", columnDefinition = "TEXT")
    @TableField("analysis_result")
    private String analysisResult;

    @Column(name = "emotion_score")
    @TableField("emotion_score")
    private Integer emotionScore;

    @Column(name = "anxiety_level")
    @TableField("anxiety_level")
    private String anxietyLevel;

    @Column(name = "suggestions", columnDefinition = "TEXT")
    @TableField("suggestions")
    private String suggestions;

    @Column(name = "created_at")
    @TableField("created_at")
    private LocalDateTime createdAt;

    @Column(name = "updated_at")
    @TableField("updated_at")
    private LocalDateTime updatedAt;

    @Column(name = "status")
    @TableField("status")
    private String status;

    @Column(name = "follow_up_needed")
    @TableField("follow_up_needed")
    private Boolean followUpNeeded;

    @Column(name = "is_deleted")
    @TableField("is_deleted")
    private Boolean isDeleted = false;

    public ThoughtAnalysis() {
        this.createdAt = LocalDateTime.now();
        this.updatedAt = LocalDateTime.now();
        this.status = "pending";
        this.followUpNeeded = false;
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getThoughtContent() {
        return thoughtContent;
    }

    public void setThoughtContent(String thoughtContent) {
        this.thoughtContent = thoughtContent;
    }

    public String getAnalysisResult() {
        return analysisResult;
    }

    public void setAnalysisResult(String analysisResult) {
        this.analysisResult = analysisResult;
    }

    public Integer getEmotionScore() {
        return emotionScore;
    }

    public void setEmotionScore(Integer emotionScore) {
        this.emotionScore = emotionScore;
    }

    public String getAnxietyLevel() {
        return anxietyLevel;
    }

    public void setAnxietyLevel(String anxietyLevel) {
        this.anxietyLevel = anxietyLevel;
    }

    public String getSuggestions() {
        return suggestions;
    }

    public void setSuggestions(String suggestions) {
        this.suggestions = suggestions;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Boolean getFollowUpNeeded() {
        return followUpNeeded;
    }

    public void setFollowUpNeeded(Boolean followUpNeeded) {
        this.followUpNeeded = followUpNeeded;
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }
}